<div class="templates view">
<h2><?php  echo __('Template');?></h2>
	<dl>
		<dt><?php echo __('Id'); ?></dt>
		<dd>
			<?php echo h($template['Template']['id']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('User'); ?></dt>
		<dd>
			<?php echo $this->Html->link($template['User']['username'], array('controller' => 'users', 'action' => 'view', $template['User']['id'])); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Created'); ?></dt>
		<dd>
			<?php echo h($template['Template']['created']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Modified'); ?></dt>
		<dd>
			<?php echo h($template['Template']['modified']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Title'); ?></dt>
		<dd>
			<?php echo h($template['Template']['title']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Description'); ?></dt>
		<dd>
			<?php echo h($template['Template']['description']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Tags'); ?></dt>
		<dd>
			<?php echo h($template['Template']['tags']); ?>
			&nbsp;
		</dd>
	</dl>
</div>
<div class="actions">
	<h3><?php echo __('Actions'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('Edit Template'), array('action' => 'edit', $template['Template']['id'])); ?> </li>
		<li><?php echo $this->Form->postLink(__('Delete Template'), array('action' => 'delete', $template['Template']['id']), null, __('Are you sure you want to delete # %s?', $template['Template']['id'])); ?> </li>
		<li><?php echo $this->Html->link(__('List Templates'), array('action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Template'), array('action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Template Flownodes'), array('controller' => 'template_flownodes', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Template Flownode'), array('controller' => 'template_flownodes', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Attachments'), array('controller' => 'attachments', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Attachment'), array('controller' => 'attachments', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Bgroups'), array('controller' => 'bgroups', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Bgroup'), array('controller' => 'bgroups', 'action' => 'add')); ?> </li>
	</ul>
</div>
<div class="related">
	<h3><?php echo __('Related Template Flownodes');?></h3>
	<?php if (!empty($template['TemplateFlownode'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Template Id'); ?></th>
		<th><?php echo __('User Id'); ?></th>
		<th><?php echo __('Loc Index'); ?></th>
		<th><?php echo __('Loc Identity'); ?></th>
		<th><?php echo __('Approved Time'); ?></th>
		<th class="actions"><?php echo __('Actions');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($template['TemplateFlownode'] as $templateFlownode): ?>
		<tr>
			<td><?php echo $templateFlownode['id'];?></td>
			<td><?php echo $templateFlownode['template_id'];?></td>
			<td><?php echo $templateFlownode['user_id'];?></td>
			<td><?php echo $templateFlownode['loc_index'];?></td>
			<td><?php echo $templateFlownode['loc_identity'];?></td>
			<td><?php echo $templateFlownode['approved_time'];?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'template_flownodes', 'action' => 'view', $templateFlownode['id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'template_flownodes', 'action' => 'edit', $templateFlownode['id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'template_flownodes', 'action' => 'delete', $templateFlownode['id']), null, __('Are you sure you want to delete # %s?', $templateFlownode['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Template Flownode'), array('controller' => 'template_flownodes', 'action' => 'add'));?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php echo __('Related Attachments');?></h3>
	<?php if (!empty($template['Attachment'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Filename'); ?></th>
		<th><?php echo __('File'); ?></th>
		<th class="actions"><?php echo __('Actions');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($template['Attachment'] as $attachment): ?>
		<tr>
			<td><?php echo $attachment['id'];?></td>
			<td><?php echo $attachment['filename'];?></td>
			<td><?php echo $attachment['file'];?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'attachments', 'action' => 'view', $attachment['id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'attachments', 'action' => 'edit', $attachment['id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'attachments', 'action' => 'delete', $attachment['id']), null, __('Are you sure you want to delete # %s?', $attachment['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Attachment'), array('controller' => 'attachments', 'action' => 'add'));?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php echo __('Related Bgroups');?></h3>
	<?php if (!empty($template['Bgroup'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Id'); ?></th>
		<th><?php echo __('Title'); ?></th>
		<th class="actions"><?php echo __('Actions');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($template['Bgroup'] as $bgroup): ?>
		<tr>
			<td><?php echo $bgroup['id'];?></td>
			<td><?php echo $bgroup['title'];?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View'), array('controller' => 'bgroups', 'action' => 'view', $bgroup['id'])); ?>
				<?php echo $this->Html->link(__('Edit'), array('controller' => 'bgroups', 'action' => 'edit', $bgroup['id'])); ?>
				<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'bgroups', 'action' => 'delete', $bgroup['id']), null, __('Are you sure you want to delete # %s?', $bgroup['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Bgroup'), array('controller' => 'bgroups', 'action' => 'add'));?> </li>
		</ul>
	</div>
</div>
